/*
 * StartStopWorldKeyListener.cpp
 *
 *  Created on: 15-01-2011
 *      Author: Przemek
 */

#include "listener/StartStopWorldKeyListener.hpp"
#include "world/World.hpp"

void StartStopWorldKeyListener::keyPressed(const KeyListener::EventArguments& arguments)
{
	if(arguments.getCharacter() == FUNCTION_CHAR)
	{
		switchWorldRunningState();
	}
}

void StartStopWorldKeyListener::switchWorldRunningState()
{
	bool running = World::getInstance().isRunning();

	World::getInstance().setRunning(!running);
}
